import store from '../../../utils/store'
import create from '../../../common/westore/create'

//获取应用实例
const app = getApp()

create({
  options: {
    addGlobalClass: true,
  },
  data: {
    StatusBar: app.globalData.StatusBar,
    CustomBar: app.globalData.CustomBar,
    cardCur: 0,
    swiperList: [{
      id: 0,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84000.jpg'
    }, {
      id: 1,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84001.jpg',
    }, {
      id: 2,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big39000.jpg'
    }, {
      id: 3,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg'
    }, {
      id: 4,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25011.jpg'
    }, {
      id: 5,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big21016.jpg'
    }, {
      id: 6,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg'
    }],

    motto: null,
    userInfo: null,
    hasUserInfo: null,
  },
  methods: {
    cardSwiper(e) {
      this.setData({
        cardCur: e.detail.current
      })
    },
    onLoad:function(options){
      this.getImageGirlList()
    },
    getUserInfo: function(e) {
      app.globalData.userInfo = e.detail.userInfo
      this.store.data.userInfo = e.detail.userInfo
      this.store.data.hasUserInfo = true
      this.update()
    },

    getImageGirlList: function (e) {
      console.log("请求数据")
      wx.request({
        url: "https://www.mxnzp.com/api/image/girl/list/random?app_id=jdtwogpauo1earwo&app_secret=dktWbURBVndMVmZzVEM1V1Zib0dHUT09",
        data: {},
        header: {'content-type': 'application/json' },
        success: function (res) {
          console.log("res",res)
        }
      })
    }

    
  }
})